#include<iostream>
using namespace std;

class Person
{
public:
    Person()
    {
        cout << "Person的默认构造函数" << endl;
    }

    Person(int a)
    {
        m_age = a;
        cout << "Person的有参构造函数" << endl;
    }

    Person(const Person& p)
    {
        m_age = p.m_age;
    }

    ~Person()
    {
        cout << "Person()的默认析构函数" << endl;
    }

    int m_age;
};

void test()
{
    Person p(10);
    Person p1(p);
    cout << "p1的年龄为:" << p1.m_age << endl;
}

int main()
{
    test();

    return 0;
}
